<%@page import="org.apache.commons.lang.StringUtils"%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="java.io.*" %>
<%@ page language="java" import="com.tangdi.production.mpapp.utils.WebPayServletUtil"
	%>
<%@ page language="java" import="com.tangdi.production.mpapp.constants.Key"
	%>
<%!public boolean sceneCheck(String scene) {
		//远程收款不会进入该界面
		if (StringUtils.isEmpty(scene)) {
			return false;
		} else if (Key.SCENE_ON_THE_SPOT.equals(scene)) {
			return true;
		} else if (Key.SCENE_CONSUMPTION.equals(scene)) {
			return true;
		}else if (Key.SCENE_CERTFICATION.equals(scene)) {
			return true;
		}else if (Key.SCENE_COMPANY.equals(scene)) {
			return true;
		}
		return false;
	}%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	request.setAttribute("on_back", "1");

	WebPayServletUtil payUtil = new WebPayServletUtil();
	String scene = request.getParameter("scene");//交易场景
	String prdOrdNo = request.getParameter("prdOrdNo");//交易场景
	
	//交易场景无效
	if (!sceneCheck(scene)) {
		payUtil.toIndexPage(request, response);
	}
	
	boolean ok = payUtil.validation(request, response);
	if (!Key.SCENE_COMPANY.equals(scene)) {
		if (!ok) {
			payUtil.toLoginPage(request, response);
		}
	}

	String respond_url = request.getParameter("respond_url");//如果是潇客充值，会有该参数
	if (respond_url == null) {
		respond_url = "";
	}
	
	//潇客充值订单号(第三方订单号)
	String subject = request.getParameter("subject");
	if (subject == null) {
		subject = "";
	}

	request.setAttribute("title", "快捷收款");
%>
<!DOCTYPE html>
<html lang="zh">
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>快捷收款</title>

<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"
	charset="UTF-8"></script>

<%
	out.write("<script type=\"text/javascript\">");
	out.write("var scene='" + scene + "';");
	out.write("var prdOrdNo='" + prdOrdNo + "';");
	out.write("</script>");
%>

<script type="text/javascript" src="js/core-1.0.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/core/loadForm.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/core/utils.js" charset="UTF-8"></script>

<script type="text/javascript">
</script>

<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="ace_v1.3/assets/css/bootstrap.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/chosen.css" />

<!-- text fonts -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace-fonts.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/font-awesome.css" />
<link rel="stylesheet" href="css/webpay/core.1.0.css" />
<link rel="stylesheet" href="css/dialog.css" />
<!-- ace styles -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />



<!--[if lte IE 9]>
			<link rel="stylesheet" href="ace_v1.3/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="ace_v1.3/assets/css/ace-ie.css" />
		<![endif]-->



<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="ace_v1.3/assets/js/html5shiv.js"></script>
		<script src="ace_v1.3/assets/js/respond.js"></script>
		<![endif]-->

<jsp:include page="../plug/head-include.jsp" />

<style type="text/css">
	.countdown_box{
		position: absolute;
		z-index: 1000;
		width: 100%;
		height: 100%;
		margin: 0;
		top: 0px;
		background: gray;
		opacity:0.9;
		display: none;
	}
	.countdown_content{
		width: 200px;
		height: 70px;
		background: white;
		margin: 0 auto;
		margin-top: 150px;
		line-height: 30px;
		text-align: center;
		
		moz-border-radius: 3px !important;      /* Gecko browsers */
	    -webkit-border-radius: 3px !important;   /* Webkit browsers */
	    border-radius:3px !important;         
	}
	
	.bank_row{
		padding: 3px 5px;
		font-size: 12px;
		font-weight: 600;
	}
	
	
</style>
</head>

<body class="no-skin">
	<!-- #section:basics/navbar.layout -->
	<jsp:include page="../plug/title.jsp" />

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">

		<!-- #section:basics/sidebar -->
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<!-- #section:basics/content.breadcrumbs -->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content">
					<!-- #section:settings.box -->
					<!-- <div class="page-header">
						<h1>
							Form Elements <small> <i
								class="ace-icon fa fa-angle-double-right"></i> Common form
								elements and layouts
							</small>
						</h1>
					</div>
					 -->
					<!-- /.page-header -->
					<!-- <div class="row">
						<div class="col-xs-12 order-desc">
							温馨提示：获取验证码之前请仔细检查各项数据输入是否正确，数据错误将导致该笔订单失效并无法重新支付；如出现上述问题导致订单无法支付，请联系收款商户重新发起收款
						</div>
					</div> -->
					
					<div class="row">
						<div class="col-sm-8 col-xs-12 col-sm-offset-2">
							<!-- PAGE CONTENT BEGINS -->

							<table id="tb_order_show"
								class="table table-striped table-bordered table-hover orderPayTable">
								<tbody>
									<tr>
										<td class="td-label">收款名称</td>
										<td class="td-data" valueOf="{goodsName}"></td>
									</tr>
									<tr>
										<td class="td-label">订单金额</td>
										<td class="td-data" valueOf="{ordamt} 元" init-format="cent2Yuan({value},false)"></td>
									</tr>
									<tr>
										<td class="td-label">订单状态</td>
										<td class="td-data" valueOf="{orderDes}"></td>
									</tr>
									<!-- <tr>
										<td class="col-xs-6 td-label">商户名称</td>
										<td class="col-xs-6 td-data" valueOf="{custName}"></td>
									</tr> -->
									<!-- <tr>
										<td class="td-label">商户号</td>
										<td class="td-data" valueOf="{custId}"></td>
									</tr> -->
									<tr>
										<td class="td-label">订单号</td>
										<td class="td-data" valueOf="{prdOrdNo}"></td>
									</tr>
									<tr>
										<td class="td-label">交易时间</td>
										<td class="td-data" style="padding-right: 0px" valueOf="{ordtime}" init-format="dateFormat('{value}')"></td>
									</tr>
									<tr>
										<td class="td-label">交易说明</td>
										<td class="td-data" valueOf="{orderDesc}" ></td>
									</tr>
							</table>
						</div>
						<!-- /.col -->
					</div>
					
					<!-- <div
						class="row-space clear-padding-left clear-padding-right clear-padding-top"></div> -->
					<form class="form-horizontal" id="orderPayForm" role="form" method="post" action="">
						<div class="row">
								
								<div
									class="clearfix col-sm-8 col-xs-12 col-sm-offset-2 menu-btn-box">
									<button id="btn_pay" class="btn btn-info btn-lg btn-block" type="button"
										>
										<i class="ace-icon fa fa-check "></i> 支 付
									</button>
								</div>
								<!-- /.col -->
							</div>
					</form>
					
					<div class="dialog_list" style="display: none;">
						<div id="bankListBox">
							<div class="tabbable">
								<ul class="nav nav-tabs" id="myTab">
									<li class="active nav-li" onclick="selectCardList(this);">
										<a data-toggle="tab" nav-id="creditCardList"  href="javascript:void(0)">
											信用卡
										</a>
									</li>
									
									<li class="nav-li" onclick="selectCardList(this);">
										<a data-toggle="tab" nav-id="debitCardList"  href="javascript:void(0)" >
											借记卡
										</a>
									</li>
								</ul>

								<div class="tab-content">
									<div id="creditCardList" class="tab-pane fade in active">
										<div class="bank_row">工商银行</div>
										<div class="bank_row">中国银行</div>
										<div class="bank_row">建设银行</div>
										<div class="bank_row">邮政储蓄</div>
										<div class="bank_row">中信银行</div>
										<div class="bank_row">光大银行</div>
										<div class="bank_row">华夏银行</div>
										<div class="bank_row">招商银行</div>
										<div class="bank_row">兴业银行</div>
										<div class="bank_row">浦发银行</div>
										<div class="bank_row">平安银行</div>
										<div class="bank_row">广发银行</div>
										<div class="bank_row">北京银行</div>
										<div class="bank_row">上海银行</div>
										<div class="bank_row">民生银行</div>
										<div class="bank_row">农业银行</div>
									</div>
									
									<div id="debitCardList" class="tab-pane fade in ">
										<div class="bank_row">建设银行</div>
										<div class="bank_row">农业银行</div>
										<div class="bank_row">工商银行</div>
										<div class="bank_row">中国银行</div>
										<div class="bank_row">浦发银行</div>
										<div class="bank_row">光大银行</div>
										<div class="bank_row">平安银行</div>
										<div class="bank_row">兴业银行</div>
										<div class="bank_row">华夏银行</div>
										<div class="bank_row">北京银行</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<!-- /.row -->
				</div>
				
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->


	</div>
	
	<!-- 跳转倒计时显示层 -->
	<div id="jump_countdown" class="countdown_box">
		<div class="countdown_content">
			
		</div>
	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<script type="text/javascript" src="js/dialog.js" charset="UTF-8"></script>
	
	<script type="text/javascript">
		function selectCardType(){
			var $sel = $("*[name='CARD_TYPE']");
			var val = $sel.val();
			var $CARD_EXPIRE = $("input[name='CARD_EXPIRE']");
			var $CVV = $("input[name='CVV']");
			if(val == "01"){//借记卡
				$CARD_EXPIRE.hide();
				$CVV.hide();
				
				$CARD_EXPIRE.attr("validate","false");
				$CVV.attr("validate","false");
			}else{//信用卡
				$CARD_EXPIRE.show();
				$CVV.show();
				
				$CARD_EXPIRE.attr("validate","true");
				$CVV.attr("validate","true");
			}
			
			$("input[name='BANKNO']").val("");//清空卡号
			$CARD_EXPIRE.val("");//清空有效期
			$CVV.val("");//清空cvv码
		}
		selectCardType();
		
		$("#bankList").on("click",function(){
			openDialog({
				title : "收款支持银行列表",
				width:"100%",
				height:"100%",
				target :"#bankListBox"
//				pageUrl :'index.jsp'
			});
		});
		
		/* $(".nav-li").each(function (){
			var $this = $(this);
			$this.on("click",function(){
				alert();
				var href = $a.attr("href");
				alert(href);
				var id = href.substring(href.indexOf("#") + 1);
				
				$(".tabbable li").removeClass("active");
				$(".tab-content").children("div").hide();
				$a.parents("li").addClass("active");
				$("#" + id).show();
			});
		}); */
		
		function selectCardList(obj){
			var $this = $(obj);
			//alert($this);
			var $a = $("a",$this);
			var id = $a.attr("nav-id");
			
			$(".tab-pane").removeClass("active");
			$(".nav-li").removeClass("active");
			
			$("#" + id).addClass("active");
			$this.addClass("active");
		}
		
	</script>

<script type="text/javascript" src="js/webpay/order_pay_ms.js"
	charset="UTF-8"></script>
	<script type="text/javascript"
		src="ace_v1.3/assets/js/jquery.maskedinput.js" charset="UTF-8"></script>
	<script type="text/javascript" src="js/jquery.tips.js" charset="UTF-8"></script>
	<link rel="stylesheet" type="text/css" href="css/dialog.css" />
	<link rel="stylesheet" type="text/css" href="css/webpay/core.1.0.css" />
</body>
</html>
